<template>
  <div class="contact-container">
    <!-- 顶部横幅 -->
    <div class="banner">
      <h1 class="banner-title">联系我们</h1>
    </div>

    <!-- 主要内容区域 -->
    <div class="main-content">
      <el-row :gutter="30">
        <!-- 左侧联系信息 -->
        <el-col :xs="24" :sm="12" :md="12" :lg="12">
          <el-card class="info-card">
            <template #header>
              <div class="card-header">
                <el-icon :size="26" color="#409EFF"><Location /></el-icon>
                <h2>我们的信息</h2>
              </div>
            </template>

            <div class="contact-info">
              <div class="info-item">
                <el-icon :size="20"><LocationFilled /></el-icon>
                <div>
                  <h3>地址</h3>
                  <p>江西省九江市濂溪区十里街道九江学院学生公寓</p>
                  <p>北京大学</p>
                </div>
              </div>

              <div class="info-item">
                <el-icon :size="20"><Iphone /></el-icon>
                <div>
                  <h3>电话</h3>
                  <p>+86 18296849605</p>
                  <p>+86 18279918795</p>
                </div>
              </div>

              <div class="info-item">
                <el-icon :size="20"><Message /></el-icon>
                <div>
                  <h3>电子邮箱</h3>
                  <p>1732775513@qq.com</p>
                  <p>1963974955@qq.com</p>
                </div>
              </div>
            </div>
          </el-card>
        </el-col>

        <!-- 右侧表单 -->
        <el-col :xs="24" :sm="12" :md="12" :lg="12">
          <el-card class="form-card">
            <template #header>
              <div class="card-header">
                <el-icon :size="26" color="#409EFF"><EditPen /></el-icon>
                <h2>在线留言</h2>
              </div>
            </template>

            <el-form :model="form" label-width="80px">
              <el-form-item label="姓名">
                <el-input v-model="form.name" placeholder="请输入您的姓名" />
              </el-form-item>

              <el-form-item label="邮箱">
                <el-input v-model="form.email" placeholder="请输入您的邮箱" />
              </el-form-item>

              <el-form-item label="主题">
                <el-input v-model="form.subject" placeholder="请输入邮件主题" />
              </el-form-item>

              <el-form-item label="内容">
                <el-input 
                  v-model="form.content"
                  type="textarea"
                  :rows="5"
                  placeholder="请输入您的留言内容"
                />
              </el-form-item>

              <el-form-item>
                <el-button type="primary" class="submit-btn">立即发送</el-button>
              </el-form-item>
            </el-form>
          </el-card>
        </el-col>
      </el-row>
    </div>

    <!-- 底部信息 -->
    <div class="footer">
      <p>© 2023 科技有限公司 版权所有</p>
    </div>
  </div>
</template>

<script setup>
import { ref } from 'vue'
import {
  Location,
  LocationFilled,
  Iphone,
  Message,
  EditPen
} from '@element-plus/icons-vue'

const form = ref({
  name: '',
  email: '',
  subject: '',
  content: ''
})
</script>

<style scoped>
:root {
  --primary-color: #409EFF;
  --secondary-color: #79bbff;
  --background-color: #f5f7fa;
}

.contact-container {
  min-height: 100vh;
  background-color: var(--background-color);
}

.banner {
  background-image: linear-gradient(120deg, #409EFF 0%, #79bbff 100%);
  padding: 80px 20px;
  text-align: center;
  color: white;
}

.banner-title {
  font-size: 2.5rem;
  margin: 0;
}

.main-content {
  max-width: 1200px;
  margin: 40px auto;
  padding: 0 20px;
}

.card-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.info-card {
  margin-bottom: 30px;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.info-item {
  display: flex;
  align-items: flex-start;
  gap: 15px;
}

.info-item h3 {
  margin: 0 0 8px 0;
  color: var(--primary-color);
}

.info-item p {
  margin: 4px 0;
  color: #666;
}

.form-card {
  margin-bottom: 30px;
}

.submit-btn {
  width: 100%;
  font-size: 16px;
}

.map-section {
  margin-top: 50px;
  text-align: center;
}

.map-section h2 {
  color: var(--primary-color);
  margin-bottom: 20px;
}

.map-image {
  width: 100%;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

.footer {
  background-color: var(--primary-color);
  color: white;
  text-align: center;
  padding: 20px;
  margin-top: 50px;
}

@media (max-width: 768px) {
  .banner {
    padding: 50px 20px;
  }
  
  .banner-title {
    font-size: 2rem;
  }
}
</style>